<?php
if ($id == "") {
    $div_style = ' style="display:block;"';
} else {
    $div_style = '';
}
?>
<form action="process.php?action=add" name="frmadd" id="frmadd" enctype="multipart/form-data" method="post" onsubmit="return checkSellerform();">

    <div class="box">
        <?php
        if ($id == "") {
            require_once(S_ROOT . '/admin/product/formadd.php');
        } else {
            ?>
            <div class="center_edit">
                <?php
                require_once(S_ROOT . '/admin/product/formedit.php')
                ?>
            </div>
            <?php
        }
        ?>
    </div>
</form> 
<script type="text/javascript" src="<?php echo base_url; ?>admin/templates/javascript/ckeditor/ckeditor.js"></script>
<script>
    $(document).ready(function() {

        /* start append 4 field in reference maintenace */
        var MaxInputs = 8; //maximum input boxes allowed
        var InputsWrapper = $("#morefield"); //Input boxes wrapper ID
        var AddButton = $("#addfield"); //Add button ID

        var x = InputsWrapper.length; //initlal text box count
        var FieldCount = 1; //to keep track of text box added

        $(AddButton).click(function(e)  //on add input button click
        {
            if (x <= MaxInputs) //max input box allowed
            {
                FieldCount++; //text box added increment
                //add input box
                $(InputsWrapper).append('<div><input type="file" name="imagefile[]" id="field_' + FieldCount + '" value="Text ' + FieldCount + '"/><a href="#" class="removeclass"><img src="<?php echo base_url;?>templates/image/remove.png"/></a></div>');
                x++; //text box increment
            }
            return false;
        });

        $("body").on("click", ".removeclass", function(e) { //user click on remove text
            if (x > 1) {
                $(this).parent('div').remove(); //remove text box
                x--; //decrement textbox
            }
            return false;
        });
    });
    $('#tabs a').tabs();
</script>

